package ${package}.${moduleName}.meta.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
*
* ${tableComment}(${functionName})
*
* @author ${author} ${email}
* @since ${version} ${date}
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("${tableName}")
@ApiModel(value="${ClassName}对象", description="${tableComment}(${tableName})")
public class ${ClassName} implements Serializable {

    private static final long serialVersionUID = 1L;

<#list fieldList as field>
    <#if !field.baseField>
        <#if field.fieldComment!?length gt 0>
    @ApiModelProperty(value = "${field.fieldComment}")
        </#if>
        <#if field.fieldName == "DELETE_MARK">
    @TableLogic(value = "0", delval = "1")
        </#if>
        <#if field.autoFill == "INSERT">
    @TableField(value = "${field.fieldName}", fill = FieldFill.INSERT)
        </#if>
        <#if field.autoFill == "INSERT_UPDATE">
    @TableField(fill = FieldFill.INSERT_UPDATE)
        </#if>
        <#if field.autoFill == "UPDATE">
    @TableField(value = "${field.fieldName}", fill = FieldFill.UPDATE)
        </#if>
        <#if field.primaryPk>
    @TableId(value = "${field.fieldName}", type = IdType.ASSIGN_ID)
        </#if>
        <#if !field.primaryPk>
    @TableField("${field.fieldName}")
        </#if>
        <#if field.attrType == 'LocalDateTime'>
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        </#if>
    private ${field.attrType} ${field.attrName};
    </#if>

</#list>
}
